<?php

/**
 * RedCross_Gateway_Base_NextOfKin
 *
 * @property integer $id
 * @property string $first_name
 * @property string $last_name
 * @property string $phone_number
 * @property integer $member_id
 * @property Doctrine_Collection $Courses
 * @property Doctrine_Collection $Interests
 * @property RedCross_Gateway_Base_Postal $Postal
 * @property RedCross_Gateway_Base_Member $Member
 *
 * @package    RedCross_Gateway_Base
 * @subpackage NextOfKin
 * @author     Håvard Lindset <lindset@gmail.com>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
class RedCross_Gateway_Base_NextOfKin extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->setTableName('next_of_kin');
        $this->hasColumn('id', 'integer', 4, array(
            'type' => 'integer',
            'primary' => true,
            'length' => '4',
        ));
        $this->hasColumn('first_name', 'string', 64, array(
            'type' => 'string',
            'notnull' => true,
            'length' => '64',
        ));
        $this->hasColumn('last_name', 'string', 64, array(
            'type' => 'string',
            'notnull' => true,
            'length' => '64',
        ));
        $this->hasColumn('phone_number', 'string', 64, array(
            'type' => 'string',
            'notnull' => true,
            'length' => '32',
        ));
        $this->hasColumn('member_id', 'integer', 4, array(
            'type' => 'integer',
            'length' => '4',
        ));
    }

    public function setUp()
    {
        parent::setUp();

        $this->hasOne('RedCross_Gateway_Base_Member as Member', array(
             'local' => 'member_id',
             'foreign' => 'id'));
         $this->hasOne('RedCross_Gateway_Base_Postal as Postal', array(
              'local' => 'postal_id',
              'foreign' => 'id'));
    }
}

?>
